package com.study.system.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.common.result.Result;
import com.study.model.system.SysLoginLog;
import com.study.model.vo.SysLoginLogQueryVo;
import com.study.system.service.SysLoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "登录日志管理")
@RestController
@RequestMapping("/admin/system/sysLoginLog")
public class SysLoginLogController {

    @Autowired
    private SysLoginLogService sysLoginLogService;

    //条件分页查询登录日志
    @ApiOperation(value = "分页查询")
    @GetMapping("{page}/{limit}")
    public Result index(@PathVariable Long page,
                        @PathVariable Long limit,
                        SysLoginLogQueryVo sysLoginLogQueryVo){
        Page<SysLoginLog> queryPage = new Page<>(page, limit);
        IPage<SysLoginLog> pageModel1 = sysLoginLogService.selectPage(queryPage, sysLoginLogQueryVo);
        return Result.ok(pageModel1);
    }
}
